#################################################################################
# Results plot: Each sector separately
#################################################################################
year <- seq(min(carbon.new$year), max(carbon.new$year),1)
OUT[[i]] <- e0$est.att[,1]
# Color settings: colorblind-friendly palette
# http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/#a-colorblind-friendly-palette
cols <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
# ATT plot
p <- ggplot() +
geom_ribbon(aes(x=year,ymin=(exp(e0$est.att[,3])-1)*100,ymax=(exp(e0$est.att[,4])-1)*100),fill=cols[1]) +
geom_line(aes(x=year,y=(exp(e0$est.att[,1])-1)*100),color=cols[3], size=1.2) +
labs(x="Year",y="Difference in CO2 emissions (percent)", title="ATT Estimates for EU ETS, 2008-2016", subtitle=paste("Sectoral emissions:",levels(carbon$sector)[i])) +
geom_vline(aes(xintercept=2005)) +
geom_vline(aes(xintercept=D), size=1.5) +
geom_hline(aes(yintercept=0),lty=2)+
scale_x_continuous(breaks=seq(min(year), max(year), by=5)) +
theme(plot.margin=unit(c(.5,.5,.5,.5),"cm"))
p
ggsave(p,filename=paste("../Figures/main/sector_",tolower(levels(carbon$sector)[i]),".pdf",sep=""),width=6.5, height=6)
}
#################################################################################
# File Name:  	Goodness-of-match_sector.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates estimates and 95% CIs for sectoral analysis
# Data input:   ../Data/ETS_analysis_sector.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# Placeholder for by-sector estimates
OUT <- matrix(NA,nrow=5,ncol=3)
# Loop through all five regulated sectors
for(i in (1:5)){
# Load data
load("../Main Data/ETS_analysis_sector.RData")
# Goodness-of-match analysis by sector (levels)
temp <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & carbon$unemit>0,] %>%
group_by(country) %>%
summarise(ratio.byc = mean(ratio, na.rm=TRUE),
emit.total= sum(unemit, na.rm=TRUE))
print(temp, n=Inf)
OUT[i,1] <- summary(temp$ratio.byc)[["Mean"]]
OUT[i,2] <- weighted.mean(temp$ratio.byc,temp$emit.total, na.rm=TRUE)
# Goodness-of-match analysis by sector (trends)
temp2 <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & is.na(carbon$ratio)==FALSE,] %>%
group_by(country) %>%
do(fitSector = lm(etsemit ~ unemit-1, data=.))
R2.list <- glance(temp2, fitSector)[,c(1,2)]
print(R2.list, n=Inf)
OUT[i,3] <- mean(R2.list$r.squared)
}
# Plot results table
str(carbon$sector)
OUT
#################################################################################
# File Name:  	Goodness-of-match_sector.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates estimates and 95% CIs for sectoral analysis
# Data input:   ../Data/ETS_analysis_sector.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# Placeholder for by-sector estimates
OUT <- matrix(NA,nrow=5,ncol=3)
# Loop through all five regulated sectors
for(i in (1:5)){
# Load data
load("../Data/ETS_analysis_sector.RData")
# Goodness-of-match analysis by sector (levels)
temp <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & carbon$unemit>0,] %>%
group_by(country) %>%
summarise(ratio.byc = mean(ratio, na.rm=TRUE),
emit.total= sum(unemit, na.rm=TRUE))
print(temp, n=Inf)
OUT[i,1] <- summary(temp$ratio.byc)[["Mean"]]
OUT[i,2] <- weighted.mean(temp$ratio.byc,temp$emit.total, na.rm=TRUE)
# Goodness-of-match analysis by sector (trends)
temp2 <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & is.na(carbon$ratio)==FALSE,] %>%
group_by(country) %>%
do(fitSector = lm(etsemit ~ unemit-1, data=.))
R2.list <- glance(temp2, fitSector)[,c(1,2)]
print(R2.list, n=Inf)
OUT[i,3] <- mean(R2.list$r.squared)
}
# Plot results table
str(carbon$sector)
OUT
#################################################################################
# File Name:  	Goodness-of-match_sector.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates estimates and 95% CIs for sectoral analysis
# Data input:   ../Main Data/ETS_analysis_sector.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         30 September 2019
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# # Shares of paper and transport sector
# mean(carbon$unemit[carbon$sector=="Paper"]/carbon$unemit[carbon$sector=="Total"],na.rm=TRUE)
# mean(carbon$unemit[carbon$sector=="Transport"]/carbon$unemit[carbon$sector=="Total"],na.rm=TRUE)
# Placeholder for by-sector estimates
OUT <- matrix(NA,nrow=5,ncol=3)
# Loop through all five regulated sectors
for(i in (1:5)){
# Load data
load("../Main Data/ETS_analysis_sector.RData")
# Goodness-of-match analysis by sector (levels)
temp <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & carbon$unemit>0,] %>%
group_by(country) %>%
summarise(ratio.byc = mean(ratio, na.rm=TRUE),
emit.total= sum(unemit, na.rm=TRUE))
print(temp, n=Inf)
OUT[i,1] <- summary(temp$ratio.byc)[["Mean"]]
OUT[i,2] <- weighted.mean(temp$ratio.byc,temp$emit.total, na.rm=TRUE)
# Goodness-of-match analysis by sector (trends)
temp2 <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & is.na(carbon$ratio)==FALSE,] %>%
group_by(country) %>%
do(fitSector = lm(etsemit ~ unemit-1, data=.))
R2.list <- glance(temp2, fitSector)[,c(1,2)]
print(R2.list, n=Inf)
OUT[i,3] <- mean(R2.list$r.squared)
}
#################################################################################
# File Name:  	Goodness-of-match_sector.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates estimates and 95% CIs for sectoral analysis
# Data input:   ../Data/ETS_analysis_sector.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# Placeholder for by-sector estimates
OUT <- matrix(NA,nrow=5,ncol=3)
# Loop through all five regulated sectors
for(i in (1:5)){
# Load data
load("../Data/ETS_analysis_sector.RData")
# Goodness-of-match analysis by sector (levels)
temp <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & carbon$unemit>0,] %>%
group_by(country) %>%
summarise(ratio.byc = mean(ratio, na.rm=TRUE),
emit.total= sum(unemit, na.rm=TRUE))
print(temp, n=Inf)
OUT[i,1] <- summary(temp$ratio.byc)[["Mean"]]
OUT[i,2] <- weighted.mean(temp$ratio.byc,temp$emit.total, na.rm=TRUE)
# Goodness-of-match analysis by sector (trends)
temp2 <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & is.na(carbon$ratio)==FALSE,] %>%
group_by(country) %>%
do(fitSector = lm(etsemit ~ unemit-1, data=.))
}
R2.list <- glance(temp2, fitSector)[,c(1,2)]
install.packages("broom")
install.packages("broom")
#################################################################################
# File Name:  	Goodness-of-match_sector.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates estimates and 95% CIs for sectoral analysis
# Data input:   ../Data/ETS_analysis_sector.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
library(broom)
# Placeholder for by-sector estimates
OUT <- matrix(NA,nrow=5,ncol=3)
# Loop through all five regulated sectors
for(i in (1:5)){
# Load data
load("../Data/ETS_analysis_sector.RData")
# Goodness-of-match analysis by sector (levels)
temp <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & carbon$unemit>0,] %>%
group_by(country) %>%
summarise(ratio.byc = mean(ratio, na.rm=TRUE),
emit.total= sum(unemit, na.rm=TRUE))
print(temp, n=Inf)
OUT[i,1] <- summary(temp$ratio.byc)[["Mean"]]
OUT[i,2] <- weighted.mean(temp$ratio.byc,temp$emit.total, na.rm=TRUE)
# Goodness-of-match analysis by sector (trends)
temp2 <- carbon[as.numeric(carbon$sector)==i & carbon$year>=2005 & is.na(carbon$ratio)==FALSE,] %>%
group_by(country) %>%
do(fitSector = lm(etsemit ~ unemit-1, data=.))
#}
R2.list <- glance(temp2, fitSector)[,c(1,2)]
print(R2.list, n=Inf)
OUT[i,3] <- mean(R2.list$r.squared)
}
str(carbon$sector)
OUT
#################################################################################
# File Name:  	GSynth_transport_placebo.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates estimates and 95% CIs for transport sector placebo test
# Data input:   ../Data/ETS_analysis_sector.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# Load data
load("../Data/ETS_analysis_sector.RData")
# Transport sector ID
i <- 7
# Restrict data to ETS regulated and unregulated emissions
carbon <- carbon[carbon$sector==levels(carbon$sector)[i] | carbon$sector=="Residual",]
carbon <- carbon[with(carbon, order(carbon$country,carbon$year,carbon$sector)),]
# Should return all 'FALSE'
table(carbon$unemit[carbon$sector=="Transport"]>carbon$unemit[carbon$sector=="Residual"])
# Subtract transport emissions from unregulated residual emissions
carbon$unemit[carbon$sector=="Residual"] <- carbon$unemit[carbon$sector=="Residual"] -  carbon$unemit[carbon$sector=="Transport"]
# Create new logged emissions variable
carbon$logUNemit <- log(carbon$unemit+1)
# Treatment assignment
D <- 2008
# Create treatment indicator
carbon$ets <- 0
carbon$ets[carbon$sector==levels(carbon$sector)[i] & carbon$year>=D] <- 1
# Create indicator for regulated/unregulated fixed effects
carbon$ctrysector <- paste(carbon$countryname,carbon$sector)
#################################################################################
# Generalized synthetic control
#################################################################################
# Gsynth does not tolerate missing data
carbon.new <- carbon[is.na(carbon$loggdp)==FALSE & is.na(carbon$logUNemit)==FALSE,]
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2, data=carbon.new, index=c("ctrysector","year"), force="two-way", se=TRUE, nboots=1000, seed=1234)
# Main results
gsynth.mean <- (exp(e0$est.avg[1])-1)*100
gsynth.mean.ci <- c((exp(e0$est.avg[3])-1)*100,(exp(e0$est.avg[4])-1)*100)
GSynth <- c(gsynth.mean,gsynth.mean.ci)
names(GSynth) <- c("GSynth","2.5% Quantile","97.5% Quantile")
print(round(GSynth,1))
#################################################################################
# ATT plot for unregulated transport sector
#################################################################################
year <- seq(min(carbon.new$year), max(carbon.new$year),1)
# Color settings: colorblind-friendly palette
# http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/#a-colorblind-friendly-palette
cols <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
# Spaghetti plot
p <- ggplot() +
geom_ribbon(aes(x=year,ymin=(exp(e0$est.att[,3])-1)*100,ymax=(exp(e0$est.att[,4])-1)*100),fill=cols[1]) +
geom_line(aes(x=year,y=(exp(e0$est.att[,1])-1)*100),color=cols[3], size=1.2) +
labs(x="Year",y="Difference in CO2 emissions (percent)", title=paste("ATT Estimates for EU ETS, 2008-2016"), subtitle="Placebo test: Unregulated transport sector") +
geom_vline(aes(xintercept=2005)) +
geom_vline(aes(xintercept=D), size=1.5) +
geom_hline(aes(yintercept=0),lty=2)+
scale_x_continuous(breaks=seq(min(year), max(year), by=5)) +
theme(plot.margin=unit(c(.5,.5,.5,.5),"cm"))
p
ggsave(p,filename="../Figures/si/transport_placebo.png",width=6.5, height=6)
#################################################################################
#                                END OF FILE
#################################################################################
#################################################################################
# File Name:  	Robustness_eu.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates gsynth estimates and 95% CIs for EU15 and EU10 countries separately
# Data input:   ../Data/ETS_analysis.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# Load data
set.seed(1234)
load("../Data/ETS_analysis.RData")
# Restrict data to ETS regulated and unregulated emissions
carbon <- carbon[carbon$sector=="Regulated" | carbon$sector=="Unregulated",]
carbon <- carbon[with(carbon, order(carbon$country,carbon$year,carbon$sector)),]
# Treatment assignment
D <- 2008
# Create treatment indicator
carbon$ets <- 0
carbon$ets[carbon$sector=="Regulated" & carbon$year>=D] <- 1
# Create indicator for regulated/unregulated fixed effects
carbon$ctrysector <- paste(carbon$countryname,carbon$sector)
# Gsynth does not tolerate missing data
carbon.new <- carbon[is.na(carbon$loggdp)==FALSE & is.na(carbon$logUNemit)==FALSE,]
#################################################################################
# Plot ATT for EU15 countries
#################################################################################
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2, data=carbon.new[carbon.new$eu15==1,], index=c("ctrysector","year"), force="two-way", se=TRUE, min.T0=7, nboots=1000, seed=1234)
e0
year <- seq(min(carbon.new$year), max(carbon.new$year),1)
# Color settings: colorblind-friendly palette
# http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/#a-colorblind-friendly-palette
cols <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
# ATT plot
p <- ggplot() +
geom_ribbon(aes(x=year,ymin=(exp(e0$est.att[,3])-1)*100,ymax=(exp(e0$est.att[,4])-1)*100),fill=cols[1]) +
geom_line(aes(x=year,y=(exp(e0$est.att[,1])-1)*100),color=cols[3],size=1.2) +
labs(x="Year",y="Difference in CO2 emissions (percent)", title="ATT Estimates for EU ETS, 2008-2016", subtitle="Generalized synthetic control: EU15 Countries") +
geom_vline(aes(xintercept=D), size=1.5) +
geom_vline(aes(xintercept=2005)) +
geom_hline(aes(yintercept=0),lty=2)+
ylim(-50,40) +
scale_x_continuous(breaks=seq(min(year), max(year), by=5)) +
theme(plot.margin=unit(c(.5,.5,.5,.5),"cm"))
p
ggsave(p,filename=paste("../Figures/si/robust_EU15.png",sep=""),width=6.5, height=6)
#################################################################################
# Plot ATT for EU10 countries
#################################################################################
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2, data=carbon.new[carbon.new$eu10==1,], index=c("ctrysector","year"), force="two-way", se=TRUE, min.T0=7, nboots=1000, seed=1234)
e0
year <- seq(min(carbon.new$year), max(carbon.new$year),1)
# Color settings: colorblind-friendly palette
# http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/#a-colorblind-friendly-palette
cols <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
# ATT plot
p <- ggplot() +
geom_ribbon(aes(x=year,ymin=(exp(e0$est.att[,3])-1)*100,ymax=(exp(e0$est.att[,4])-1)*100),fill=cols[1]) +
geom_line(aes(x=year,y=(exp(e0$est.att[,1])-1)*100),color=cols[3],size=1.2) +
labs(x="Year",y="Difference in CO2 emissions (percent)", title="ATT Estimates for EU ETS, 2008-2016", subtitle="Generalized synthetic control: EU10 Countries") +
geom_vline(aes(xintercept=D), size=1.5) +
geom_vline(aes(xintercept=2005)) +
geom_hline(aes(yintercept=0),lty=2)+
ylim(-50,40) +
scale_x_continuous(breaks=seq(min(year), max(year), by=5)) +
theme(plot.margin=unit(c(.5,.5,.5,.5),"cm"))
p
ggsave(p,filename=paste("../Figures/si/robust_EU10.png",sep=""),width=6.5, height=6)
#################################################################################
#                                END OF FILE
#################################################################################
#################################################################################
# File Name:    Robustness_leaveoneout.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates gsynth estimates when one country is left out at a time
# Data input:   ../Data/ETS_analysis.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# Load data
load("../Data/ETS_analysis.RData")
# Restrict data to ETS regulated and unregulated emissions
carbon <- carbon[carbon$sector=="Regulated" | carbon$sector=="Unregulated",]
carbon <- carbon[with(carbon, order(carbon$country,carbon$year,carbon$sector)),]
ctry.list <- unique(carbon$country)
OUT <- list()
# Loop through countries and plot outputs separately
for(i in (1:length(ctry.list))){
# Treatment assignment
D <- 2008
# Create treatment indicator
carbon$ets <- 0
carbon$ets[carbon$sector=="Regulated" & carbon$year>=D] <- 1
# Create indicator for regulated/unregulated fixed effects
carbon$ctrysector <- paste(carbon$countryname,carbon$sector)
#################################################################################
# Generalized synthetic control: Leave one out estimates
#################################################################################
# Gsynth does not tolerate data with missings
carbon.new <- carbon[is.na(carbon$loggdp)==FALSE & is.na(carbon$logUNemit)==FALSE,]
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2, data=carbon.new[carbon.new$country!=ctry.list[i],], index=c("ctrysector","year"), force="two-way", se=TRUE, nboots=1000, seed=1234)
e0
OUT[[i]] <- e0$est.att[,1]
}
#################################################################################
# Generalized synthetic control: All country estimates
#################################################################################
eall <- gsynth(logUNemit ~ ets + loggdp + loggdp2, data=carbon.new, index=c("ctrysector","year"), force="two-way", se=TRUE, nboots=1000, seed=1234)
eall
#################################################################################
# Robustness plot: Leave one out
#################################################################################
library(plyr)
# Color settings: colorblind-friendly palette
# http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/#a-colorblind-friendly-palette
cols <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
year <- seq(min(carbon.new$year), max(carbon.new$year),1)
df <- ldply(OUT, data.frame)
df$year <- rep(year,length(ctry.list))
df$ctry <- sort(rep(ctry.list,length(year)))
# ATT plot
p <- ggplot() +
geom_line(data=df,aes(x=year,y=(exp(df[,1])-1)*100,group=ctry),color=cols[1]) +
geom_line(aes(x=year,y=(exp(eall$est.att[,1])-1)*100),color=cols[3], size=1.2) +
labs(x="Year",y="Difference in CO2 emissions (percent)", title="ATT Estimates for EU ETS, 2008-2016", subtitle="Leave-One-Out Robustness") +
geom_vline(aes(xintercept=D), size=1.5) +
geom_vline(aes(xintercept=2005)) +
geom_hline(aes(yintercept=0),lty=2)+
ylim(-30,10) +
scale_x_continuous(breaks=seq(min(year), max(year), by=5)) +
theme(plot.margin=unit(c(.5,.5,.5,.5),"cm"))
p
ggsave(p,filename=paste("../Figures/si/robust_leaveoneout.png",sep=""),width=6.5, height=6)
#################################################################################
#                                END OF FILE
#################################################################################
#################################################################################
# File Name:  	Robustness_modelspec.R
# Project:			EU ETS effectiveness paper
# Purpose:      Creates estimates and 95% CIs for alternative model specifications
# Data input:   ../Data/ETS_analysis.RData
# Output File:
# Author: 		  Patrick Bayer
# Date:         13 April 2020
#################################################################################
# Load required packages
library(foreign)
library(gsynth)
library(tidyverse)
# Load data
load("../Data/ETS_analysis.RData")
# Restrict data to ETS regulated and unregulated emissions
carbon <- carbon[carbon$sector=="Regulated" | carbon$sector=="Unregulated",]
carbon <- carbon[with(carbon, order(carbon$country,carbon$year,carbon$sector)),]
# Treatment assignment
D <- 2008
# Create treatment indicator
carbon$ets <- 0
carbon$ets[carbon$sector=="Regulated" & carbon$year>=D] <- 1
# Create indicator for regulated/unregulated fixed effects
carbon$ctrysector <- paste(carbon$countryname,carbon$sector)
#################################################################################
# Generalized synthetic control
#################################################################################
# Estimates for ETS 2008: GDP per capita added
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2 + loggdppc, data=carbon,
index=c("ctrysector","year"),
force="two-way",
se=TRUE, nboots=1000, seed=1234,
na.rm=TRUE)
# Main results
gsynth.mean <- (exp(e0$est.avg[1])-1)*100
gsynth.mean.ci <- c((exp(e0$est.avg[3])-1)*100,(exp(e0$est.avg[4])-1)*100)
GSynth <- c(gsynth.mean,gsynth.mean.ci)
names(GSynth) <- c("GSynth","2.5% Quantile","97.5% Quantile")
print(round(GSynth,1))
# Estimates for ETS 2008: Population added
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2 + logpop, data=carbon,
index=c("ctrysector","year"),
force="two-way",
se=TRUE, nboots=1000, seed=1234,
na.rm=TRUE)
# Main results
gsynth.mean <- (exp(e0$est.avg[1])-1)*100
gsynth.mean.ci <- c((exp(e0$est.avg[3])-1)*100,(exp(e0$est.avg[4])-1)*100)
GSynth <- c(gsynth.mean,gsynth.mean.ci)
names(GSynth) <- c("GSynth","2.5% Quantile","97.5% Quantile")
print(round(GSynth,1))
# Estimates for ETS 2008: Renewable electricity production added
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2 + logrenew, data=carbon,
index=c("ctrysector","year"),
force="two-way",
se=TRUE, nboots=1000, seed=1234,
na.rm=TRUE)
# Main results
gsynth.mean <- (exp(e0$est.avg[1])-1)*100
gsynth.mean.ci <- c((exp(e0$est.avg[3])-1)*100,(exp(e0$est.avg[4])-1)*100)
GSynth <- c(gsynth.mean,gsynth.mean.ci)
names(GSynth) <- c("GSynth","2.5% Quantile","97.5% Quantile")
print(round(GSynth,1))
# Estimates for ETS 2008: Carbon tax indicator added
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2 + carbontax, data=carbon,
index=c("ctrysector","year"),
force="two-way",
se=TRUE, nboots=1000, seed=1234,
na.rm=TRUE)
# Main results
gsynth.mean <- (exp(e0$est.avg[1])-1)*100
gsynth.mean.ci <- c((exp(e0$est.avg[3])-1)*100,(exp(e0$est.avg[4])-1)*100)
GSynth <- c(gsynth.mean,gsynth.mean.ci)
names(GSynth) <- c("GSynth","2.5% Quantile","97.5% Quantile")
print(round(GSynth,1))
# Estimates for ETS 2008: full model
e0 <- gsynth(logUNemit ~ ets + loggdp + loggdp2 + loggdppc + logpop + logrenew + carbontax, data=carbon,
index=c("ctrysector","year"),
force="two-way",
se=TRUE, nboots=1000, seed=1234,
na.rm=TRUE)
# Main results
gsynth.mean <- (exp(e0$est.avg[1])-1)*100
gsynth.mean.ci <- c((exp(e0$est.avg[3])-1)*100,(exp(e0$est.avg[4])-1)*100)
GSynth <- c(gsynth.mean,gsynth.mean.ci)
names(GSynth) <- c("GSynth","2.5% Quantile","97.5% Quantile")
print(round(GSynth,1))
#################################################################################
#                                END OF FILE
#################################################################################
